<template>
  <div class="pagebody">
    <StickHead></StickHead>
    <div class="headtop bgfff text-al-center fz30">我的</div>
    <div class="thingbox borderbox">
      <div class="user flex-row align-center">
        <img src="@/static/img/tx.png" alt="" />
        <div class="user_info ">
          <div class="name fz32 fwbold">{{this.userinfo.nickName}}</div>
          <div class="phone fz28 fwbold ">{{this.userinfo.phonenumber}}</div>
        </div>
      </div>
      <div
        class="card mb25 bgfff borderbox justify-between flex-row align-center mt20"
        @click="toInfo('information')"
      >
        <div class="left align-center">
          <img src="@/static/img/qy.png" alt="" />
          <div class="fz28 fwbold color000">企业信息</div>
        </div>
        <img src="@/static/img/breadright.png" alt="" />
      </div>
      <div
        class="card mb25 bgfff borderbox justify-between flex-row align-center mt20"
        @click="toInfo('myproblemlist')" v-if="qyFlag||adminFlag"
      >
        <div class="left align-center">
          <img src="@/static/img/question_icon.png" alt="" />
          <div class="fz28 fwbold color000">我的问题</div>
        </div>
        <img src="@/static/img/breadright.png" alt="" />
      </div>
      <!-- <div
        class="card mb25 bgfff borderbox justify-between flex-row align-center mt20"
      >
        <div class="left align-center">
          <img src="@/static/img/headimg.png" alt="" />
          <div class="fz28 fwbold color000">我的通知</div>
        </div>
        <img src="@/static/img/breadright.png" alt="" />
      </div> -->
    </div>
    <StickFoot :type="'myself'"></StickFoot>
  </div>
</template>

<script>
import StickHead from "@/layout/StickHead.vue";
import StickFoot from "@/layout/StickFoot.vue";
export default {
  name: "myself",
  components: {
    StickHead,
    StickFoot,
  },
  data() {
    return {
      userinfo:{},
      qyFlag:false,
      zwFlag:false,
      adminFlag:false,
    };
  },
  mounted() {
      this.userinfo = JSON.parse(window.localStorage.getItem("userinfo"));
      this.qyFlag = this.userinfo.roles.includes("qy");
      this.zwFlag = this.userinfo.roles.includes("zw");
      this.adminFlag = this.userinfo.roles.includes("admin");
  },
  methods: {
    toInfo(type) {
      this.$router.push({ name: type });
    },
    getuser(){
      this.user = JSON.parse(window.localStorage.getItem("userinfo"))
    }
  },
};
</script>

<style lang="scss" scoped>
.pagebody {
  background: #f6f7fb;
  .headtop {
    line-height: 0.8rem;
    height: 0.8rem;
  }
  .thingbox {
    padding: 0 0.32rem;
    .user {
      height: 2rem;
      img {
        width: 1rem;
        height: 1rem;
        border-radius: 50%;
      }
      .user_info {
        margin-left: 0.32rem;
        .name {
          font-size: 0.36rem;
          color: #333;
        }
        .phone {
          font-size: 0.28rem;
          color: #205ce3;
          margin-top: 0.1rem;
        }
      }
    }
    .card {
      height: 1.5rem;
      border-radius: 0.24rem;
      padding: 0 0.24rem;
      .left {
        img {
          width: 0.5rem;
          height: 0.5rem;
          border-radius: 50%;
          margin-right: 0.2rem;
        }
      }
      img {
        width: 0.2rem;
        margin-right: 0.24rem;
      }
    }
  }
}
</style>